import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react({
      babel: {
        plugins: ['babel-plugin-glsl']
      }
    })
  ],
  server: {
    proxy: {
      // 代理QQ音乐API请求
      '/api/qqmusic': {
        target: 'https://your-api-proxy-server.com', // 需要替换为实际的代理服务器地址
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api\/qqmusic/, '')
      }
    }
  },
  define: {
    // 确保process.env在客户端可用
    'process.env': {}
  }
})